/*
 * Copyright/Licensing information.
 */

/* inclusion guard */
#ifndef __VIEWER_FILE_H__
#define __VIEWER_FILE_H__

#include <glib-object.h>
/*
 * Potentially, include other headers on which this header depends.
 */

G_BEGIN_DECLS

/*
 * Type declaration.
 */
#define VIEWER_TYPE_FILE viewer_file_get_type ()

#ifdef DERIVABLE //DERIVABLE
G_DECLARE_DERIVABLE_TYPE (ViewerFile, viewer_file, VIEWER, FILE, GObject)

struct _ViewerFileClass{
    GObjectClass parent_class;

    /* Class virtual function fields. */
    void (* open) (ViewerFile  *file,
                   GError     **error);
    void (* close) (ViewerFile  *file,
                   GError     **error);
    gboolean (* can_memory_map) (ViewerFile *file);

    /* Padding to allow adding up to 12 new virtual functions without
     * breaking ABI. */
    gpointer padding[12];
};

#else

G_DECLARE_FINAL_TYPE (ViewerFile, viewer_file, VIEWER, FILE, GObject)

#endif //DERIVABLE

/*
 * Method definitions.
 */


G_END_DECLS

void viewer_file_open (ViewerFile  *self, const gchar *file);
void
viewer_file_write (ViewerFile   *self,
                   const gchar *buffer,
                   gsize         size);
void viewer_file_close (ViewerFile  *self, GError **error);

#endif /* __VIEWER_FILE_H__ */
